Skip to contentSkip to conversation

size of lvm metadata

linux-lvm Tomas Dalebjörk 2 participants 4 messages Sep 16, 2020 – Dec 20, 2021

lore
Share & tools
lore
#0 lore raw

hi

I am trying to understand how big the lvm metadata is

in the vgcfgbackup file, I can see
extent_size = 8192
dev_size = 204800
pe_start = 2048
pe_count 24

pe_count(24) * extent_size(8192) = 196608 bytes usable space of the total dev_size(204800) metadata size? = dev_size(204800) - 196608 = 8192

but...
pe_start is 2048?
so what is pe_start here? cant be sectors(512)? bytes? well than ther be not aligned

so where starts the actual data?
and where ends the lvm metadata?

regards Tomas
Sent from my iPhone

#1 lore raw

Tomas,

the first PE starts at offset 2048 sectors of size 512 bytes by default, i.e. the LVM MDA (metadata area)
is ~1MiB big (because the MDA starts at offset 1 page into the device).  If you plan for large numbers of LVs or expect very scattered allocations which both grow the metadata, you may want to create a bigger MDA using vgcreate's option --metadatasize (also see /etc/lvm/lvm.conf description on
metadata/pvmetadatasize).

Quoted 1 line · Tomas Dalebjörk

hi > > I am trying to understand how big the lvm metadata is > > in the

vgcfgbackup file, I can see extent_size = 8192 dev_size = > 204800 pe_start = 2048 pe_count 24 > > pe_count(24) * extent_size(8192) = 196608 bytes usable space of the > total dev_size(204800) metadata size? = dev_size(204800) - 196608 = > 8192 > > but... pe_start is 2048? so what is pe_start here? cant be > sectors(512)? bytes? well than ther be not aligned > > so where starts the actual data? and where ends the lvm metadata?

At offset 2048 sectors (1MiB into the device) / MDA ends at sector 2047.

Mind that lvm2 metadata is text formatted (see /etc/lvm/backup/$VGName for one) and thus varies in size (the MDA is used as a ring buffer for 2 copies of the MDA to support atomic updates).  As pointed out above when refering to 'vgcreate --metadatasize', in more elaborate setups you may run out of MDA space.

Heinz

Quoted 1 line
Quoted 1 line

regards Tomas Sent from my iPhone > > >

_______________________________________________ linux-lvm mailing > list [email protected] > https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO > at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw

ok

Ithanks

Quoted 3 lines

pe_count(24) * extent_size(8192) = 196608 bytes usable space of the

Quoted 2 lines

total dev_size(204800) metadata size? = dev_size(204800) - 196608 = 8192

Sent from my iPhone

Quoted 43 lines · Heinz Mauelshagen

 Tomas,

the first PE starts at offset 2048 sectors of size 512 bytes by default, i.e. the LVM MDA (metadata area)
is ~1MiB big (because the MDA starts at offset 1 page into the device). If you plan for large numbers of LVs or expect very scattered allocations which both grow the metadata, you may want to create a bigger MDA using vgcreate's option --metadatasize (also see /etc/lvm/lvm.conf description on
metadata/pvmetadatasize).

Quoted 7 lines · Tomas Dalebjörk

hi

I am trying to understand how big the lvm metadata is

in the vgcfgbackup file, I can see extent_size = 8192 dev_size = 204800 pe_start = 2048 pe_count 24

Quoted 8 lines

pe_count(24) * extent_size(8192) = 196608 bytes usable space of the total dev_size(204800) metadata size? = dev_size(204800) - 196608 = 8192

but... pe_start is 2048? so what is pe_start here? cant be sectors(512)? bytes? well than ther be not aligned

so where starts the actual data? and where ends the lvm metadata?

At offset 2048 sectors (1MiB into the device) / MDA ends at sector 2047.

Mind that lvm2 metadata is text formatted (see /etc/lvm/backup/$VGName for one) and thus varies in size (the MDA is used as a ring buffer for 2 copies of the MDA to support atomic updates). As pointed out above when refering to 'vgcreate --metadatasize', in more elaborate setups you may run out of MDA space.

Heinz

Quoted 8 lines

regards Tomas Sent from my iPhone

_______________________________________________ linux-lvm mailing list [email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
In reply to Heinz Mauelshagen

Hi

if I have a disk that are merged into a server coming from another server containing a lvm snapshot How can I convert this foreign disk to an existing lv volume?

The documentation says I can use lvconvert-Zn -s targetvg/targetlv sourcevg/sourcelv

But I guess I have to perform some lvm metadata recreation first?

please let me know what steps are neede

Regards Tomas

Sent from my iPhone

Quoted 25 lines · Heinz Mauelshagen

 Tomas,

the first PE starts at offset 2048 sectors of size 512 bytes by default, i.e. the LVM MDA (metadata area)
is ~1MiB big (because the MDA starts at offset 1 page into the device). If you plan for large numbers of LVs or expect very scattered allocations which both grow the metadata, you may want to create a bigger MDA using vgcreate's option --metadatasize (also see /etc/lvm/lvm.conf description on
metadata/pvmetadatasize).

Quoted 7 lines · Tomas Dalebjörk

hi

I am trying to understand how big the lvm metadata is

in the vgcfgbackup file, I can see extent_size = 8192 dev_size = 204800 pe_start = 2048 pe_count 24

Quoted 8 lines

pe_count(24) * extent_size(8192) = 196608 bytes usable space of the total dev_size(204800) metadata size? = dev_size(204800) - 196608 = 8192

but... pe_start is 2048? so what is pe_start here? cant be sectors(512)? bytes? well than ther be not aligned

so where starts the actual data? and where ends the lvm metadata?

Quoted 18 lines

At offset 2048 sectors (1MiB into the device) / MDA ends at sector 2047.

Mind that lvm2 metadata is text formatted (see /etc/lvm/backup/$VGName for one) and thus varies in size (the MDA is used as a ring buffer for 2 copies of the MDA to support atomic updates). As pointed out above when refering to 'vgcreate --metadatasize', in more elaborate setups you may run out of MDA space.

Heinz

Quoted 8 lines

regards Tomas Sent from my iPhone

_______________________________________________ linux-lvm mailing list [email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/